How to solve these challenges:
To be consistent with the filenames and paths run the commands on Ubuntu
Write your solution in a terminal and test it.
If your solution is not correct, then try to understand the error messages, watch the video again, rewrite the solution and test it again. Repeat this step until you get the correct solution.
Save the solution in a file for future reference or recap.
Challenge #1
Create a function called now that prints out the current date and type in format: YYYY-MM-DD HH:MM:SS
Call the function.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #2
Create a function called rectangle_area that takes 2 arguments: width and height.
The function computes and prints out the area of the rectangle.
Call the function with different arguments.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #3
Create a Bash Menu with the following entries:
Display Date and Time
List users logged in
Display disk usage
Change the Menu Prompt to the string Choose:
Implement each entry in the menu using the if...elif..else statements.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #4
Change the solution from the previous challenge so that you use case instead of if...elif..else to implement the menu entries.
Are you stuck? Do you want to see the solution for this challenge? Click here.